<template>
  <div>
    <h2>App组件（直接调用）</h2>
    <p>{{ $store.state.user.age }}</p>
    <p>{{ $store.getters['user/pingfang'] }}</p>
    <button @click="$store.commit('user/updateAge', 30)">更新age</button>
    <button @click="$store.dispatch('user/updateAgeAfter2s', 100)">
      2s后更新age
    </button>

    <MyTest />
  </div>
</template>

<script>
import MyTest from '@/components/MyTest.vue'
export default {
  components: {
    MyTest
  }
}
</script>

<style></style>
